package com.chx.three.mama.activities;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.RadioGroup;
import android.widget.Toast;

import com.chx.three.mama.R;
import com.chx.three.mama.view.SildingFinishLayout;

public class SocialMailDetailActivity extends Activity
        implements SildingFinishLayout.OnSildingFinishListener, RadioGroup.OnCheckedChangeListener, View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_social_mail_detail);

        SildingFinishLayout finishLayout = (SildingFinishLayout) findViewById(R.id.social_mail_sliding_finish);
        finishLayout.setOnSildingFinishListener(this);

        RadioGroup radioGroup = (RadioGroup) findViewById(R.id.social_mail_radios);
        radioGroup.check(R.id.social_mail_radio01);
        radioGroup.setOnCheckedChangeListener(this);

        ImageView back = (ImageView) findViewById(R.id.social_mail_back);
        back.setOnClickListener(this);

    }

    @Override
    public void onSildingFinish() {
        super.finish();
    }
    @Override
    public void finish() {
        super.finish();
        this.overridePendingTransition(0,R.anim.push_right_exit);
    }

    @Override
    public void onBackPressed() {
        finish();
    }

    @Override
    public void onCheckedChanged(RadioGroup group, int checkedId) {
        switch (checkedId){
            case R.id.social_mail_radio01:
                Toast.makeText(this,"01",Toast.LENGTH_SHORT).show();
                break;
            case R.id.social_mail_radio02:
                Toast.makeText(this,"02",Toast.LENGTH_SHORT).show();
                break;
        }
    }

    @Override
    public void onClick(View v) {
        finish();
    }
}
